package cn.edu.scau.cmi.yangzhengkai.client.classicsDesignPattern;

import javax.swing.GroupLayout.Alignment;

import cn.edu.scau.cmi.yangzhengkai.interProgramming.*;
import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.FlowPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;
import javafx.stage.Stage;

public class InterProgrammingClient extends Application{


	@Override
	public void start(Stage primaryStage){
		
		FlowPane fp = new FlowPane();
		Button b1 = new Button("在校生");
		b1.setPrefSize(150, 50);
		Button b2 = new Button("毕业生");
		b2.setPrefSize(150, 50);
		HBox hb = new HBox();
		hb.setMargin(b1, new Insets(0.0, 0.0, 0.0, 50.0));
        hb.setSpacing(100.0);
		hb.getChildren().addAll(b1,b2);
		Label lb1 = new Label("请选择您的学位:");
		lb1.setFont(new Font(20));
		Label lb2 = new Label();
		lb2.setFont(new Font(20));
		b1.setOnMouseClicked(new EventHandler<MouseEvent>() {

			@Override
			public void handle(MouseEvent event) {
				Student undergraduatestudent = new UndergraduateStudent();
				lb2.setText(undergraduatestudent.learning());
			}

			
		});
		
		b2.setOnMouseClicked(new EventHandler<MouseEvent>() {

			@Override
			public void handle(MouseEvent event) {
				Student graduatestudent = new GraduateStudent();
				lb2.setText(graduatestudent.learning());
			}

			
		});
		VBox vb = new VBox();
		vb.getChildren().addAll(lb1,hb,lb2);
		vb.setSpacing(20.0);
		fp.getChildren().add(vb);
		
		Scene scene = new Scene(fp);
		primaryStage.setScene(scene);
		primaryStage.setHeight(600);
		primaryStage.setWidth(600);
		primaryStage.show();
	}

}
